home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / RIncludes / Collections.r < prev    next >
Encoding:
Text File  |  1998-02-12  |  3.1 KB  |  106 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Collections.r
  3.  
  4.      Contains:    Collection Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.x
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __COLLECTIONS_R__
  20. #define __COLLECTIONS_R__
  21.  
  22. #ifndef __CONDITIONALMACROS_R__
  23. #include "ConditionalMacros.r"
  24. #endif
  25.  
  26. // 'cltn' - definition of a collection resource (loaded by GetNewCollection)
  27. type 'cltn' {
  28.     longint = $$CountOf(ItemArray);
  29.     array ItemArray
  30.         {
  31.         longint;    // tag
  32.         longint;    // id
  33.             boolean        itemUnlocked            =    false,    // defined attributes bits...
  34.                         itemLocked                =    true;
  35.             boolean        itemNonPersistent        =    false,
  36.                         itemPersistent            =    true;
  37.             unsigned bitstring[14] = 0;                        // reserved attributes bits...
  38.             unsigned bitstring[16];                            // user attributes bits...
  39.         wstring;
  40.         align word;
  41.     };
  42. };
  43.  
  44. // 'flac' - definition of a flattened collection (created by Flatten[Partial]Collection)
  45. // Note that due to the complexity of this format, it is possible to create 'flac' resources
  46. // using Rez, but it is not possible to DeRez them. DeRez cannot currently handle multiple
  47. // undefined labels as used in this type definition. Instead, DeRez just emits the raw data.
  48. // Some important other limitations:
  49. //     Zero-length items aren't supported.
  50. //     Entries in the item array must be sorted by tag and ID.
  51. //     Entries in the data array must be in the same order as corresponding item array entries.
  52. // Here's an example of using the 'flac' resource type:
  53. //     resource 'flac' (128)
  54. //     {
  55. //         0x40000020,
  56. //         {
  57. //             'TEST', 2, itemUnlocked, itemPersistent, 0x02,
  58. //             'TEST', 3, itemUnlocked, itemPersistent, 0x04,
  59. //             'TEST', 4, itemUnlocked, itemPersistent, 0x08
  60. //         },
  61. //         {
  62. //             "foo",
  63. //             "bird",
  64. //             "The quick brown fox jumped over the lazy dog"
  65. //         }
  66. //     };
  67. type 'flac'
  68. {
  69.     longint = 0x00010000;            // version
  70.     longint    noAttributes = 0;            // default collection attributes
  71.     longint = $$CountOf(ItemArray);        // number of items
  72.     array ItemArray            // array of items
  73.     {
  74.         literal longint;    // tag
  75.         longint;            // id
  76.         boolean        itemUnlocked        =    false,    // defined attributes bits
  77.                     itemLocked            =    true;
  78.         boolean        itemNonPersistent    =    false,
  79.                     itemPersistent        =    true;
  80.         unsigned bitstring[14] = 0;                    // reserved attributes bits
  81.         unsigned bitstring[16];                        // user attributes bits
  82.         
  83.         // offset in data block to item data (to the data itself, not to the length)
  84.         longint = (itemData[$$ArrayIndex(ItemArray)] - dataStart) / 8;
  85.     };
  86. dataSize:
  87.     longint = ((dataEnd - dataSize) / 8) - 4;        // size of data
  88. dataStart:
  89.     array ItemDataArray
  90.     {
  91. itemSize:
  92.         // size of this item's data
  93.         longint = ((itemEnd[$$ArrayIndex(ItemDataArray)] - itemSize[$$ArrayIndex(ItemDataArray)]) / 8) - 4;
  94. itemData:
  95.         hex string;            // the item's data
  96. itemEnd:
  97.         ;
  98.         align word;
  99.     };
  100. dataEnd:
  101.     ;
  102. };
  103.  
  104. #endif /* __COLLECTIONS_R__ */
  105.  
  106.